import React from 'react'
import { useEffect } from 'react'

function Bai() {
	useEffect(() => {
		// 百度地图API功能
		// var map = new window.BMap.Map("allmap");  // 创建Map实例
		// map.centerAndZoom("上海",15);      // 初始化地图,用城市名设置地图中心点
		var map = new window.BMap.Map("l-map");            // 创建Map实例
		map.centerAndZoom(new window.BMap.Point(116.404, 39.915), 11);
		var myKeys = ["酒店", "加油站"];
		var local = new window.BMap.LocalSearch(map, {
			renderOptions:{map: map, panel:"r-result"},
			pageCapacity:5
		});
		local.searchInBounds(myKeys, map.getBounds());
	}, [])
	return (
		<div>
			{/* <div id="allmap"></div> */}

			<div id="l-map"></div>
			<div id="r-result"></div>
		</div>
	)
}

export default Bai
